#include <stdio.h>
#include <fcntl.h>
#include <netinet/in.h>
int main()
{
	int fd = 0;
	int ret = 0;
	fd = socket(AF_INET, SOCK_STREAM, 0); 
	if(fd < 0) {
	perror("socket");
		return 1;
	} 

	struct sockaddr_in dst;
	dst.sin_family = AF_INET;
	dst.sin_port = htons(12211);
	dst.sin_addr.s_addr = inet_addr("1.116.177.134");
	
	ret = connect(fd, &dst, 16);
	if(ret < 0) {
		perror("connect");
		return 1;
	} 
	while(1){
		unsigned char data[1024] = {0};
		ret = recv(fd, data, 1024, 0); 
		if(ret < 0) {
			perror("recv");
			return 1;
		} 
		printf("%s\n", data);
		if(data == NULL){
			return 0;
		}
	}
}
